package com.spring.xiatian.order.service.TemplateService;

import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;


/**
 * 方式一：消费 注入template模板
 *
 * Created by Created by xiaoxia on 2017/11/17 0030 19:21.
 */
@Service
public class UserServiceTemp {

    @Autowired
    RestTemplate restTemplate;

    public String getUserList(){
        String req = "";
        ResponseEntity<Object> res = restTemplate.postForEntity("http://scb-user/api/list",req,Object.class);
        return JSON.toJSONString(res.getBody());
    }


}
